/*
 * 组件注释
 * @Author: machinist_wq
 * @Date: 2022-05-03 13:57:01
 * @LastEditors: machinist_wq
 * @LastEditTime: 2022-09-02 23:13:12
 * @Description: 删除提示框
 * 人生无常！大肠包小肠......
 */
"use strict";
import { Modal } from "antd";
import { ExclamationCircleOutlined } from "@ant-design/icons";

const Index = props => {
  const {
    title: content,
    disabled,
    onConfirm = () => {},
    children,
    ...args
  } = props;

  const confirm = () => {
    Modal.confirm({
      title: "提示",
      icon: <ExclamationCircleOutlined />,
      content: content,
      okText: "确认",
      cancelText: "取消",
      ...args,
      onOk: () => onConfirm(),
    });
  };

  return (
    <span
      onClick={e => {
        e.stopPropagation();
        !disabled ? confirm() : null;
      }}>
      {children}
    </span>
  );
};
export default Index;
